package com.metka.volidata.controllor;

import com.metka.volidata.annotation.Valid;
import com.metka.volidata.annotation.Valids;
import com.metka.volidata.entity.Order;
import com.metka.volidata.entity.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Metka499
 * @Description:
 * @CreateTime: 2020/7/6 14:31
 */
@RestController
public class UserControllor {


    @Valids(
            {@Valid(name = "user.order.id", min = 4,required = true)}
    )
    @RequestMapping("/test")
    public String validata(@RequestBody User user, @RequestParam(required = false) String code) {

        return "success";
    }
}
